<?php

/**
 * @author Martin Pernica
 * @copyright 2008
 */
$query = $GLOBALS['db']->query("SELECT * FROM ".$GLOBALS['db_prefix']."menu WHERE position = 'right' ORDER BY weigh");
echo '<h2><span>Menu</span></h2><ul>';
while($data = $query->fetch_object()){
 if(preg_match("/http:/i", $data->href) || preg_match("/www/i", $data->href) || preg_match("/https:/i", $data->href) || preg_match("/ftp:/i", $data->href)){
         echo '<li class="menu_item"><a href="'.$data->href.'">'.$data->title.'</a></li>';
	}else{
         echo '<li class="menu_item"><a href="'.$GLOBALS['url'].$data->href.'">'.$data->title.'</a></li>';
	}
}
echo '</ul>';
?>